<?php
require_once './include/common.inc.php';
require_once AK_ROOT.'include/global.func.php';

function collectfile($file) {
	$return = array();
	$files = readpathtoarray($file, 1);
	foreach($files as $_file) {
		$f = $file.'/'.$_file;
		if(is_dir($f)) {
			$return[$_file] = collectfile($f);
		} else {
			if($_file == 'files.inc.php') continue;
			if($_file == 'collectfiles.php') continue;
			$return[] = $_file;
		}
	}
	return $return;
}
$files = collectfile('.');
writetofile("<?php\n".'$files = unserialize(\''.serialize($files)."');\n?>", 'files.inc.php');
debug('done.');
?>